$(function() {  
    FastClick.attach(document.body);  
});
var h1=$('.classifyList li').height();  //84
var h2 = $('.heade').height();//77
var h3 = $('footer').height();//84
var h6 = parseInt((document.documentElement.clientHeight-h2-h3)/h1);   //1013-77-84=852
var myScroll;

		function loaded() {
			setTimeout(function(){
				myScroll = new iScroll('wrapper', {
				scrollbarClass: 'myScrollbar', tap: true
			})
			},100)
		
		}
        
		window.addEventListener('load', loaded, false);


//点击
$('.classifyList li ').click(function() {
	  
				for(var k = 0; k < $('.classifyList li').length; k++) {
					index = $('.classifyList li').index(this);
										 
				}
				var hh = $('.classifyList').css('top');  
				var hh1= hh.split('px');
				var hh2 = hh1[0];
				var h5 = -($('.classifyList li').length*h1-h6);   //-324  
				var value = -(index*h1)+2*h1;
				 alert(hh2);
				if(2<=index&&index<$('.classifyList li').length-7){
					
					alert(value)
					$('.classifyList').css({top:value+'px'});
				};
				if(index>=$('.classifyList li').length-7){
					alert(2)
					    var values =-($('.classifyList li').length-h6)*h1;
						$('.classifyList').css({top:values+'px'});
					}
				$('.classifyList li a').css({
					color: 'rgb(102,102,102)',
					background: 'rgb(220,219,219)'
				
				});
				
				$(this).find('a').css({
					color: 'rgb(202,14,84)',
					background: 'rgb(255,255,255)'
					
				});

			});
